{extend name="public:layout" /}
{block name="title"}店铺管理{/block}
{block name="head"}
<style>
    .area_name select{width:33%;float:left;}
</style>
{/block}
{block name="body"}
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li class="active">店铺设置</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">公司名称</label>
                    <div class="col-sm-10">
                        <p class="form-control-static">{$info.company_name}</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺名称</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" placeholder="请输入店铺名称"
                               name="site_name" value="{$info.site_name}" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">主营产品</label>
                    <div class="col-sm-6">
                        <textarea class="form-control" name="site_main" rows="3">{$info.site_main}</textarea>
                        <p class="help-block">关键字最多可输入50字，请用","进行分隔</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺LOGO</label>
                    <div class="col-sm-4">
                        {:widget('common/Form/singleImg',['site_logo','',$uid])}
                        <div class="help-block">建议使用宽200像素-高60像素内的GIF或PNG透明图片</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺BANNER</label>
                    <div class="col-sm-4">
                        {:widget('common/Form/singleImg',['site_banner','',$uid])}
                        <div class="help-block">建议使用宽1200像素*高250像素的图片</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺电话</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺电话"
                               name="site_tel" value="{$info.site_tel}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺QQ</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺QQ"
                               name="site_qq" value="{$info.site_qq}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺地址</label>
                    <div class="col-sm-3">
                        {php}
                        $areaValue = $info['prov_id'].','.$info['city_id'].','.$info['dist_id'];
                        {/php}
                        {:widget('common/Form/areaName',['prov_id,city_id,dist_id',$areaValue])}
                    </div>
                    <div class="col-sm-3">
                        <input type="text" class="form-control" placeholder="请输入店铺地址"
                               name="address" value="{$info.address}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">LBS定位</label>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <input type="text" class="form-control" name="coordinate" value="{$info.lat},{$info.lng}">
                            <span class="input-group-btn"> <button onclick="getpos()" type="button" class="btn btn-primary">定位
                                        </button> </span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">SEO关键词</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" name="site_keywords" value="{$info.site_keywords}" />
                        <p class="help-block">用于店铺搜索引擎的优化，关键字之间请用英文逗号分隔</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">SEO店铺描述</label>
                    <div class="col-sm-6">
                        <textarea class="form-control" name="site_description" rows="3">{$info.site_description}</textarea>
                        <p class="help-block">用于店铺搜索引擎的优化，建议120字以内</p>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">免运费额度</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入免运费额度"
                               name="site_free_price" value="{$info.site_free_price}" />
                        <p class="help-block">默认为 0，表示不设置免运费额度，大于0表示购买金额超出该值后将免运费</p>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" type="button" id="btnSub">保存内容</button>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        ajaxSubForm('#btnSub',function () {
            layer.msg('店铺信息修改成功!');
            $("#validError").removeClass('Validform_loading').removeClass('Validform_wrong').text('');
        });
    });
    function getpos() {
        In('layer',function () {
            layer.open({
                type: 2,
                title: '请点击后复制坐标',
                shadeClose:true,
                area: ['90vw', '90vh'],
                anim: 2,
                content: ["{:url('/plus/Bmap/getPos')}"]
            });
        })
    }
</script>
{/block}